package com.maochang.top.service.impl;


import com.maochang.top.bean.TUser;
import com.maochang.top.dao.UserDao;
import com.maochang.top.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserDao UserDao;

    @Override
    public boolean seve(TUser tUser) {
        int add = UserDao.add(tUser);
        return add>1?true:false;
    }

    @Override
    public TUser getByName(String userName) {
        TUser byName = UserDao.getByName(userName);
        return byName;
    }

    @Override
    public boolean delByName(String userName) {
        int i = UserDao.delByName(userName);
        return i>1?true:false;
    }

    @Override
    public boolean update(String userName) {
        int i = UserDao.delByName(userName);
        return i>1?true:false;
    }

    @Override
    public List<TUser> getList() {
        List<TUser> userList = UserDao.getUserList();
        return userList;
    }
}
